package com.liuzh.deviceinfo.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.view.View;
import c.h.a.m0.h;

public class ScreenBlackWhiteView extends View {
    public int[] a = new int[]{-16777216, -15724528, -14671840, -13619152, -12566464, -11513776, -10461088, -9408400, -8355712, -7303024, -6250336, -5197648, -4144960, -3092272, -2039584, -986896};
    public String[] b = new String[]{"#000000", "#101010", "#202020", "#303030", "#404040", "#505050", "#606060", "#707070", "#808080", "#909090", "#A0A0A0", "#B0B0B0", "#C0C0C0", "#D0D0D0", "#E0E0E0", "#F0F0F0"};
    public Paint c = new Paint(1);
    public Paint d;

    public ScreenBlackWhiteView(Context context) {
        super(context);
        Paint paint = new Paint(1);
        this.d = paint;
        paint.setTextSize((float) h.u(12.0f, getResources().getDisplayMetrics()));
    }

    public void onDraw(Canvas canvas) {
        int i;
        int width = getWidth();
        int height = getHeight();
        int i2 = 8;
        if (width > height) {
            i2 = 2;
            i = 8;
        } else {
            i = 2;
        }
        height /= i2;
        width /= i;
        for (int i3 = 0; i3 < i2; i3++) {
            for (int i4 = 0; i4 < i; i4++) {
                int i5 = i4 * width;
                int i6 = i3 * height;
                int i7 = (i3 * i) + i4;
                this.c.setColor(this.a[i7]);
                float f = (float) i5;
                float f2 = (float) i6;
                canvas.drawRect(f, f2, (float) (i5 + width), (float) (i6 + height), this.c);
                if (i7 < this.a.length / 2) {
                    this.d.setColor(-1);
                } else {
                    this.d.setColor(-16777216);
                }
                canvas.drawText(this.b[i7], (this.d.getTextSize() * 0.2f) + f, (this.d.getTextSize() * 1.2f) + f2, this.d);
            }
            Canvas canvas2 = canvas;
        }
    }
}
